#ifndef ProgEnv_First
#define ProgEnv_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Types.h"
#include "Object.h"

class Class;
class VObject;
class ObjectViewPolicy;
class PathLookup;

//---- ProgEnv -----------------------------------------------------------------
// entry points for the ET++ programming environment

class ProgEnv : public Object {
public:
	MetaDef(ProgEnv);
	ProgEnv();

	virtual void Start();

	//---- source code browser
	virtual void EditSourceOf(Class *cp, bool def, int at= -1);
	virtual void ShowInHierarchy(Class *cp);
	virtual void ShowInheritancePath(Class *cp);

	//---- inspector
	virtual void ShowInObjStruBrowser(Object *op);
	virtual void InspectObject(Object *op, bool block= FALSE);
	virtual void InspectClick(VObject *vop);

	//---- object views
	virtual void AddObjectViewPolicy(ObjectViewPolicy*);
	virtual char *HasObjectView(Class *cl, void *addr, Object *op);
	virtual void ShowObjectView(Class *cl, void *addr, Object *op, Object *insp);

	virtual PathLookup *Universe();
	virtual bool FileOfClass(Class *cl, char *fname, bool decl);
};

//---- ObjectViewPolicy --------------------------------------------------------

class ObjectViewPolicy: public Object {
public:
	MetaDef(ObjectViewPolicy);
	ObjectViewPolicy();
	virtual char *ViewName(Class *cl, void *addr, Object *op);
	virtual bool ShowView(Class *cl, void *addr, Object *op, Object *);
};

//---- SmartProgenv ------------------------------------------------------------

class SmartProgenv {
	ProgEnv *pe;

	ProgEnv *make();
public:
	SmartProgenv()
		{ }
	~SmartProgenv()
		{ SafeDelete(pe); }
	ProgEnv *operator -> ()
		{ return make(); }
	operator ProgEnv* ()
		{ return make(); }
};

extern SmartProgenv gProgEnv;

#endif
